#include <iostream>
using namespace std;
#define int long long
signed main() {
    int n;
    cin >> n;
    int i = n / 998244353;
    int t = n % 998244353 + 1;
    int s2 = (t * i) % 998244353;
    cout << s2 << endl;
    return 0;
}